home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / atileg1a / map.cls < prev    next >
Text File  |  1999-09-28  |  2KB  |  66 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "Map"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
  15. Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
  16. 'local variable(s) to hold property value(s)
  17. Private mvarItem() As Tile 'local copy
  18.  
  19. Private CurrentTiles As Integer
  20. 'local variable(s) to hold property value(s)
  21. Private mvarRows As Integer 'local copy
  22. Private mvarCols As Integer 'local copy
  23.  
  24. Public Property Get Cols() As Integer
  25.     Cols = mvarCols
  26. End Property
  27.  
  28. Public Property Get Rows() As Integer
  29.     Rows = mvarRows
  30. End Property
  31.  
  32. Public Sub AddItem(I1 As Integer, Optional MovementFactor As Integer)
  33.   Set mvarItem(CurrentTiles) = New Tile
  34.   mvarItem(CurrentTiles).Image = I1
  35.   
  36.   CurrentTiles = CurrentTiles + 1
  37. End Sub
  38.  
  39. Public Sub CreateArray(row As Integer, col As Integer)
  40.   ReDim mvarItem(col * row)
  41.   mvarRows = row
  42.   mvarCols = col
  43.   CurrentTiles = 0
  44. End Sub
  45.  
  46. Public Property Set Item(Index As Integer, vData As Tile)
  47.   Set mvarItem(Index) = vData
  48. End Property
  49.  
  50. Public Property Get Item(Index As Integer) As Tile
  51. Attribute Item.VB_UserMemId = 0
  52.   If Index > UBound(mvarItem) Then
  53.     Set Item = Nothing
  54.   Else
  55.     Set Item = mvarItem(Index)
  56.   End If
  57. End Property
  58.  
  59. Public Sub ClearArray()
  60.   For i = 0 To UBound(mvarItem)
  61.     Set mvarItem(i) = New Tile
  62.   Next
  63. End Sub
  64.  
  65.  
  66.